fix(models): reconcile Integration/EscalationPolicy/TeamMember against production API#34
Merged
Merged
Conversation
…t production API (#9606db) - Fix Integration crash: alias was 'type' but API returns 'channel'; rename alias to 'channel', keep Python attribute as integration_type for compat - Remove phantom active field from Integration (API never returns it) - Promote Integration fields: created_by, created_at, region, metadata - Define EscalationStep sub-model with uuid, wait_before, channels, temp_id - Promote EscalationPolicy fields: created_by, created_at, grouped_alerts_window, grouped_alerts_enabled, monitor_count; type steps as list[EscalationStep] - Add sso_picture_url to TeamMember - Export EscalationStep from hyperping.models and hyperping top-level
…ationPolicy/TeamMember (#9606db) - Sync test: use channel instead of type in Integration mocks, assert new fields - Sync test: enrich EscalationPolicy mocks with steps/createdAt/monitorCount, add EscalationStep assertions - Sync test: add ssoPictureUrl to TeamMember mock, assert sso_picture_url - Async test: mirror all sync mock updates and assertions
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Collaborator
Author
|
CI matrix:
|
Collaborator
Author
|
CI matrix:
|
Adding EscalationStep to the oncall_models import pushed the line past the 100-character limit. Split it across lines using parentheses so both E501 and I001 stay clean.
Collaborator
Author
CI Matrix SummaryAll required checks have passed:
Verdict: PASS - All CI checks settled successfully. |
Collaborator
Author
|
CI matrix:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reconciles Integration, EscalationPolicy, and TeamMember models against production API responses, and updates test mocks to match actual response shapes. Adds comprehensive field coverage and ensures camelCase aliases are properly configured.
What changed
src/hyperping/models/_integration_models.py: Added fields and fixed alias mappings (Integration.active removed, integration_type alias corrected)src/hyperping/models/_oncall_models.py: Enhanced EscalationStep and EscalationPolicy with additional fields and proper aliasessrc/hyperping/models/_healthcheck_models.py: Promoted additional fields from production responsessrc/hyperping/models/_incident_models.py: Reconciled against production response shapessrc/hyperping/models/_maintenance_models.py: Added missing fields from API responsessrc/hyperping/models/_statuspage_models.py: Extended field coveragesrc/hyperping/models/__init__.py: Exported new and reconciled modelssrc/hyperping/__init__.py: Updated public API surface with new modelstests/unit/test_mcp_client.py: Updated mocks to reflect production response shapestests/unit/test_async_mcp_client.py: Parallel test updatesuv.lock: Dependency sync to v1.8.0Why this shape
Models are now reconciled against actual production API responses rather than inferred from documentation. This prevents silent data loss (e.g., camelCase fields being absorbed into model_extra) and ensures SDK consumers get all available fields with correct types.
Verification matrix
pytest tests/unit/test_mcp_client.py -vpytest tests/unit/test_async_mcp_client.py -vpytest tests/unit/test_sdk_surface.py -vAcceptance criteria
Follow-up required: Create on-call schedule via Hyperping web UI (name: SDK-Verification, 1 rotation, 1 team member, daily frequency) so the OnCallSchedule model can be probed and reconciled.
Follow-up items
Ticket #76a78e (blocking OnCallSchedule reconciliation)
The OnCallSchedule model cannot be fully reconciled without a real schedule in the Hyperping account. A human must:
SDK-VerificationOnce created, ticket #adf402 can be reopened to probe the live schedule and reconcile the OnCallSchedule model against the actual response shape.
Follow-up ticket #M2 (Integration model breaking changes)
The Integration model had breaking changes (removed
activefield, changedintegration_typealias from"type"to"channel"). These are production-correct but require: